package com.wcll.www;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class DeleteJSAvatarBean {
	private Connection con = null;
	public Connection getCon() {
		return con;
	}
	public void setCon(Connection con) {
		this.con = con;
	}
	public boolean deleteJobSort(int id){
		boolean flags = false;
		try{
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost/jobs?useUnicode=true&characterEncoding=UTF8","root","");
			con.setAutoCommit(false);
			Statement st = con.createStatement();
			Statement st1 = con.createStatement();
			st1.execute("delete from job_assort_avatar where ja_id="+id);
			st.execute("delete from job_assort where id="+id);
			con.commit();
			int i = st.getUpdateCount();
			if(i==1){
				flags = true;
			}
			st.close();
			st1.close();
	}catch(Exception e){
		try{
			con.rollback();
			}catch(Exception e1){}
	}
		return flags;
	}
}
